{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">店铺审核列表</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"
               data-auth-add="{:$auth->check('business.ebusiness/add')}"
               data-auth-edit="{:$auth->check('business.ebusiness/edit')}"
               data-auth-delete="{:$auth->check('business.ebusiness/del')}"
        ></table>
    </div>
</div>

<script type="text/html" id="barTool">
    <a data-open='{:url("verify")}?id={{ d.id }}'
       class="layui-btn layui-btn-xs layui-btn-normal {:$auth->check('shop.eshop/verify')?'':'layui-hide'}"
       title="店铺审核" data-full="true">店铺审核</a>
</script>

<!--操作模板-->

{/block}
{block name="script"}
<script>
    layui.use('yznTable', function () {
        var table = layui.yznTable;
        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            add_url: "{:url('add')}",
            edit_url: "{:url('edit')}",
            delete_url: "{:url('del')}",
        };
        table.render({
            init: init,
            autoWidth: true,
            toolbar: ['refresh',],
            url: '{:url("index")}',
            search: false,
            cols: [
                [
                    {type: 'checkbox', fixed: 'left'},
                    {field: 'id', width: '4%', title: 'ID'},
                    {field: 'shop_name', align: "center", width: '15%', title: '店铺名称', searchOp: 'like'},
                    {field: 'people', align: "center", width: '10%', title: '店铺负责人', searchOp: 'like'},
                    {field: 'phone', align: "center", width: '10%', title: '电话'},
                    {field: 'province', align: "center", width: '8%', title: '省'},
                    {field: 'city', align: "center", width: '8%', title: '市'},
                    {field: 'area', align: "center", width: '8%', title: '区'},
                    {field: 'address', align: "center", width: '10%', title: '详细地址'},
                    {
                        field: 'status', align: "center", width: '8%', title: '审核状态', templet: function (d) {
                            if (d.status == 0) {
                                return '<span style="color: red">待审核</span>';
                            } else if (d.status == 1) {
                                return '<span style="color: green">审核通过</span>';
                            } else if (d.status == 2) {
                                return '<span style="color:  #00B7EE ">冻结</span>';
                            } else if (d.status == 3) {
                                return '<span style="color: orangered">审核失败</span>';
                            } else {
                                return '<span>未知</span>';
                            }
                        }, search: false
                    },
                    {field: 'create_time', align: "center",width: '15%',  title: '申请时间', search: 'range'},
                    {fixed: 'right', align: "center", width: '10%', title: '操作', toolbar: '#barTool'}//delete'
                ]
            ],
            page: {}
        });
        yznTable.bindevent();

        // selectElement2 = document.getElementById('searchFieldset_currentTable');
        // selectElement2.classList.remove("layui-hide");
        // var element = document.getElementById('layui-input-search');

        element.parentNode.removeChild(element);
    });
</script>
{/block}